import request from '@/api/utils/request';
/**
 *  excel导入房间信息
 *  from-data格式   file :  ~~~~
 * */
export const createRoomExcel = data =>
  request({
    method: 'post',
    url: '/schDormitoryRoom/createRoomExcel',
    data
  });

// 添加房间信息
export const createRoom = data =>
  request({
    method: 'post',
    url: '/schDormitoryRoom/createRoom',
    data
  });
/**
 * 编辑回显
 */
export const schDormitoryRoom = id =>
  request({
    method: 'get',
    url: '/schDormitoryRoomDuty/getRoomDetailsInfo/' + id
  });
// 修改房间信息
export const updateRoom = data =>
  request({
    method: 'post',
    url: '/schDormitoryRoom/updateRoom',
    data
  });
// 房间列表
export const getRoom = data =>
  request({
    method: 'get',
    url: '/schDormitoryRoom/getRoomList',
    params: data
  });
// 房间详情
export const getRoomDetails = id =>
  request({
    method: 'get',
    url: '/schDormitoryRoom/getRoomDetails/' + id
  });
// 批量删除房间信息  [1,2,3]
export const deleteRoom = data =>
  request({
    method: 'delete',
    url: '/schDormitoryRoom/deleteRoom',
    data
  });

/**
 * 修改房间使用状态
 * @param
 *       id
 *       useState : 使用状态0 已启用，1已停用
 * @returns
 */
export const updateRoomState = data =>
  request({
    method: 'post',
    url: '/schDormitoryRoom/updateRoomState',
    data
  });

/**
 *  excel导入值日生信息
 *  from-data格式   file :  ~~~~
 * */
export const createRoomDutyExcel = data =>
  request({
    method: 'post',
    url: '/schDormitoryRoomDuty/createRoomDutyExcel',
    data
  });

/**
 * 添加值日生信息
 * */
export const createRoomDuty = data =>
  request({
    method: 'post',
    url: '/schDormitoryRoomDuty/createRoomDuty',
    data
  });

/**
 * 获取房间的值日生信息
 */
export const getRoomDuty = id =>
  request({
    method: 'get',
    url: '/schDormitoryRoomDuty/getRoomDuty/' + id
  });

/**
 * 删除值日生信息
 * roomId : 房间id
 * week:    周几(1 到 7)
 */
export const removeRoomDuty = data =>
  request({
    method: 'delete',
    url: '/schDormitoryRoomDuty/removeRoomDuty/',
    params: data
  });

/**
 * 修改床位状态
 * id    床位id
 * bedState  床铺启用状态(0代表启用 1代表停用)
 */
export const updateBedState = data =>
  request({
    method: 'post',
    url: '/schDormitoryBed/updateBedState',
    data
  });

/**
 * 获取房间的学生信息
 */
export const getRoomStudent = id =>
  request({
    method: 'get',
    url: '/schDormitoryRoomDuty/getRoomStudent/' + id
  });
/**
 * 获取房间的详情
 */
export const getRoomInfo = id =>
  request({
    method: 'get',
    url: '/schDormitoryRoom/getRoomInfo/' + id
  });
